package pers.ree.demo.reflect;

import java.lang.reflect.Proxy;

public class ProxyDemo {

    public static void main(String[] args) {
        TargetImpl target = new TargetImpl();

        ProxyHandler proxyHandler = new ProxyHandler(target);

        TargetInf1 targetInf1 = (TargetInf1) Proxy.newProxyInstance(target.getClass().getClassLoader(),
                target.getClass().getInterfaces(), proxyHandler);

        targetInf1.say();
    }
}
